package main

type ListNode struct {
	Val  int
	Next *ListNode
}

func hasCycle(head *ListNode) bool {
	flag := false
	for {
		if head == nil {
			break
		}
		if head.Val != -100001 {
			head.Val = -100001
		} else {
			flag = true
			break
		}
		head = head.Next
	}
	return flag
}
func main() {
	head := &ListNode{}
	hasCycle(head)
}
